.TH std::bit_xor 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::bit_xor \- std::bit_xor

.SH Synopsis
   Defined in header <functional>
   template< class T >             \fI(until C++14)\fP
   struct bit_xor;
   template< class T = void >      \fI(since C++14)\fP
   struct bit_xor;

   Function object for performing bitwise XOR. Effectively calls operator^ on type T.

.SH Specializations

   The standard library provides a specialization of std::bit_xor when T
   is not specified, which leaves the parameter types and return type to
   be deduced.
                                                                          \fI(since C++14)\fP
   bit_xor<void> function object implementing x ^ y deducing parameter
   \fI(C++14)\fP       and return types
                 \fI(class template specialization)\fP

.SH Member types

   Type                                                         Definition
   result_type (deprecated in C++17)(removed in C++20)          T
   first_argument_type (deprecated in C++17)(removed in C++20)  T
   second_argument_type (deprecated in C++17)(removed in C++20) T

   These member types are obtained via publicly inheriting                \fI(until C++11)\fP
   std::binary_function<T, T, T>.

.SH Member functions

   operator() returns the result of bitwise XOR of two arguments
              \fI(public member function)\fP

std::bit_xor::operator()

   T operator()( const T& lhs, const T& rhs ) const;            \fI(until C++14)\fP
   constexpr T operator()( const T& lhs, const T& rhs ) const;  \fI(since C++14)\fP

   Returns the result of bitwise XOR of lhs and rhs.

.SH Parameters

   lhs, rhs - values to compute bitwise XOR of

.SH Return value

   The result of lhs ^ rhs.

.SH Exceptions

   May throw implementation-defined exceptions.

.SH Possible implementation

   constexpr T operator()(const T& lhs, const T& rhs) const
   {
       return lhs ^ rhs;
   }

   Defect reports

   The following behavior-changing defect reports were applied retroactively to
   previously published C++ standards.

     DR    Applied to              Behavior as published               Correct behavior
   LWG 660 C++98      function objects for bitwise operations are      added
                      missing
